<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"
	import="java.util.*,com.telecom.cms.dbconnect.*,com.telecom.cms.dao.*,com.telecom.cms.dto.*,java.sql.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Insert title here</title>
		<link rel="stylesheet" type="text/css" href="images/main.css">
		<STYLE type=text/css>
BODY {
	SCROLLBAR-FACE-COLOR: #f2f2f2;
	SCROLLBAR-HIGHLIGHT-COLOR: #f2f2f2;
	SCROLLBAR-SHADOW-COLOR: #b7b7b7;
	SCROLLBAR-3DLIGHT-COLOR: #f2f2f2;
	SCROLLBAR-ARROW-COLOR: #999999;
	SCROLLBAR-TRACK-COLOR: #e9e9e9;
	SCROLLBAR-DARKSHADOW-COLOR: #f2f2f2;
	margin-left: 0px;
}
</STYLE>
		<script type="text/javascript" language="javascript">
        function f(){
        
       
          var r = <%
                    List list1 = (List)request.getSession().getAttribute("Outputlist");
                    out.print(null==list1?0:list1.size());
   
          %> ;
          var m = <%
          
                    List list2 = (List)request.getSession().getAttribute("AtomList");
                    out.print(null==list2?0:list2.size());
          %> ;
          
          
             if(m==0){
           
                    
              alert("请点击条件区定制\n选择查询属性条件!!"); 
              return ;    
           
           } 
      

          if(r==0)
            {
        
              alert("请点击结果定制区\n结果目标字段选取!!"); 
              return ;    
          
            } 
          
          var p = document.form1.billing_cycle_y.value;
          var q = document.form1.billing_cycle_m.value;
          var latnid = <%=request.getSession().getAttribute("selectlatnid")%>;


          if(p==00||q==00){
			alert("请定制账务月!!"); 
              return ;      
          }
}
		function cancelaction(){
		     
		 document.form1.action="again.do" ;
		 
		 document.form1.target="_self";
		  
		 form1.submit();
		 for(i=0;i<300;i++){} //造成延时
		 window.parent.upFrame.location.reload();
		
		}
		
		
		function changelatn(){

		
		 document.form1.action="latnchange.do";
		 
		 document.form1.target="_self";
		  
		 form1.submit();
		
		
		}
		
		<!--新建一个弹出窗口用来返回选定的路径id与保存名称-->
		
		function openwindow(){ 
		 
		 
		          
          var p = <%
                    List list3 = (List)request.getSession().getAttribute("Outputlist");
                    out.print(null==list3?0:list3.size());
   
          %> ;
          var q = <%
          
                    List list4 = (List)request.getSession().getAttribute("AtomList");
                    out.print(null==list4?0:list4.size());
          %> ;
         if(p==0){
         
                 alert("请定制好收藏主题的结果");
                 return ;
         
         }
         if(q==0){
         
                 alert("请定制好收藏主题的条件");
                 return ; 
         
         }
		   
		else{
         window.open("NewBox.jsp","_newBox","height=400, width=350, toolbar=no, menubar=no,  resizable=no, location=no, status=no");
            }
       }       
		function opensub(){
		
		   document.form1.action="CollectionAction" ;
           document.form1.submit(document.form1.parfolderid);
       }
       //write by warren
        function refreshUp(){
	       	window.parent.atomArea.window.location.reload();
        }
		function f_frameStyleResize(targObj){
		  var targWin=targObj.parent.document.all[targObj.name];
		  if(targWin!=null){
		    var HeightValue=targObj.document.body.scrollHeight;
		    targWin.style.pixelHeight=HeightValue;
		  }
		}
		function f_iframeResize(){
		  f_frameStyleResize(self);
		  window.parent.parent.topFrame.location.reload();
		}
		window.onload=f_iframeResize;

        </script>

	</head>

	<body>
		<form action="query.do" target="_blank" name="form1">
			<table width="780" cellspacing="0" cellpadding="0" border="0">
				<tbody>
					<tr>
						<td width="3" height="31">
							<img height="31" src="images/table_01.gif" width="3">
						</td>
						<td background="images/table_02.gif" height="31">
							<table cellspacing="0" cellpadding="0" width="146" align="left"
								border="0">
								<tbody>
									<tr>
										<td width="51" background="images/title_1_bg.gif">
											<img height="31" src="images/title_1.gif" width="51">
										</td>
										<td width="95" background="images/title_1_bg.gif">
											<span class="color_b_666">条件定制结果</span>
										</td>
									</tr>
								</tbody>
							</table>
						</td>
						<td width="3">
							<img height="31" src="images/table_03.gif" width="3">
						</td>
					</tr>
					<tr>
						<td height="172">
							<img height="100%" src="images/table_04.gif" width="3">
						</td>
						<td style="PADDING-TOP: 3px" valign="top">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td>
										<table width="771" border="0" cellpadding="1" cellspacing="1"
											class="moduleList" bgcolor="#D5D5D5" align="center">
											<tr>
												<td colspan="3" background="images/th_02.gif">
													条件定制
												</td>
											</tr>
											<tr bgcolor="#FFFFFF">
												<td width="163" align="center">
													条件说明
												</td>
												<td width="448" align="center">
													条件数值
												</td>
												<td width="129" align="center">
													删除所选条件
												</td>
											</tr>
											<%
												Calendar myCalendar = Calendar.getInstance();
											%>
											<tr bgcolor="#FFFFFF">
												<td align="center">
													账务月
												</td>
												<td align="center">
													<select name="billing_cycle_y" onchange="changelatn()">
														<%
															String billing_y = (String) session.getAttribute("billing_cycle_y");
															String billing_m = (String) session.getAttribute("billing_cycle_m");
															for (int myYear = 2006; myYear < 2010; myYear++) {
														%>
														<option value="<%=myYear%>"
															<%																
																if(Integer.parseInt(billing_y)==myYear){
																	out.print("selected");
																}
															%>>
															<%=myYear%>
														</option>
														<%
															}
														%>
													</select>
													<select name="billing_cycle_m" onchange="changelatn()">
														<%
															for (int myMon = 1; myMon < 13; myMon++) {
														%>
														<option value="<%=myMon%>"
															<%
																if(Integer.parseInt(billing_m)==myMon){
																	out.print("selected");
																}
															%>>
															<%=myMon%>
															月
														</option>
														<%
															}
														%>
													</select>
												</td>
												<td align="center">
													&nbsp;


												</td>
											</tr>
											<tr bgcolor="#FFFFFF">
												<td align="center">
													本地网
												</td>
												<td align="center">
													<%
														String latndesc = ((String) session.getAttribute("latndesc"))
																.trim();
														out.print(latndesc);

														String selectlatnid = (String) session.getAttribute("selectlatnid");

														int sid = 0;
														if (null != selectlatnid) {
															sid = Integer.parseInt(selectlatnid);

														}
														if (latndesc.equals("湖北省中心")) {
															out.print("请选择：");
															List latnidlist = new LOC_LATNDAO().findAll();
															Iterator i = latnidlist.iterator();

															out
																	.print("<select name=selectlatnid id=selectlatnid onchange='changelatn()'>");

															while (i.hasNext()) {
																LOC_LATNDTO dto = (LOC_LATNDTO) (i.next());
																String id = dto.getLatn_id();

																int oid = Integer.parseInt(id);

																if (id.equals("1000")) {
																	continue;
																}
																String desc = dto.getLatn_desc();
																out
																		.print("<option value= "
																				+ id
																				+ (null != selectlatnid && oid == sid ? "  selected"
																						: "") + " >" + desc + "</option>");
															}
															out.print("</select>");

														}
													%>
												</td>
												<td align="center">
												</td>
											</tr>

											<c:forEach var="atom" items="${AtomList}">
												<tr bgcolor="#FFFFFF">
													<td align="center">
														${atom.atomname}
													</td>
													<td align="center">
														${atom.chinesevalue}
													</td>
													<td align="center">
														<a href="deletrecord.do?recordname=${atom.atomid}"
															onclick="refreshUp()">删除</a>
													</td>
												</tr>
											</c:forEach>
										</table>
									</td>
								</tr>

							</table>
						</td>
						<td background="images/table_05.gif">
							<img height="53" src="images/table_05.gif" width="3">
						</td>
					</tr>
					<tr>
						<td width="3">
							<img height="12" src="images/table_06.gif" width="3">
						</td>
						<td height="3">
							<img height="3" src="images/table_07.gif" width="100%">
						</td>
						<td width="3">
							<img height="12" src="images/table_08.gif" width="3">
						</td>
					</tr>
				</tbody>
			</table>
		</form>
	</body>
</html>
